<?php 
	include("includes/connect.php");
	include("includes/function.php");

	$ppID = $_REQUEST["ppID"];

	$db = new myDBS;
	$sql = "SELECT assetID, amount, quatity, UnitName, resourceMoney_1, resourceMoney_2 FROM pp_check_job_detail chkjob, pp_unit unit WHERE chkjob.UnitID = unit.UnitID and ppID = '$ppID'";

	$result = $db->runSQL($sql);

?>
<table class="table table-striped" width="100%" >
		<caption><br></caption>
		<thead>
			<tr>
				<th>#</th>
				<th>หมายเลขครุภัณฑ์</th>
				<th>งบประมาณ</th>
				<th>จำนวน</th>
				<th>หน่วยนับ</th>
				<th>แหล่งที่มา 1</th>
				<th>แหล่งที่มา 2</th>
			</tr>
		</thead>
		<tbody>
				
			<?php
				$i=0;
				while ( $rows = $db->fetch_object ( $result )){
					$i++;
			?>
			<tr>
			  <td><?php echo $i; ?></td>
			  <td><?php echo $rows->assetID; ?></td>
			  <td><?php echo number_format($rows->amount); ?></td>
			  <td><?php echo $rows->quatity; ?></td>
			  <td><?php echo $rows->UnitName; ?></td>
			  <td><?php echo number_format($rows->resourceMoney_1); ?></td>
			  <td><?php echo number_format($rows->resourceMoney_2); ?></td>
			</tr>
			<?php
				}
			?>
		</tbody>

	</table>
		<div class="form-actions">
	
		<button class="btn close-dialog"><i class="icon-remove"></i> ปิดหน้าต่าง</button>

	</div>
